export const nodeOps = {
  querySelector(selector:string) {
    return document.querySelector(selector)
  },

  createElement(tag:string) {},
  createText(text:string) {
    return document.createTextNode(text)
  },
  createComment() {},
  
  insert(child:Node, parent:HTMLElement, ancher:Node|null=null) {
    if(ancher) parent.insertBefore(child, ancher)
    else parent.appendChild(child)
  },
  
  remove(child:Node) {
    const parent = child.parentNode
    if(parent) parent.removeChild(child)
  },

  cloneNode() {},

  setElementText(el:HTMLElement, text:string) {
    el.textContent = text
  }
  
}
